﻿using System;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x0200009B RID: 155
	[RequireComponent(typeof(AnimatorController3rdPerson))]
	public class CharacterController3rdPerson : MonoBehaviour
	{
		// Token: 0x0600054D RID: 1357 RVA: 0x00005559 File Offset: 0x00003759
		public void Start()
		{
			this.animatorController = base.GetComponent<AnimatorController3rdPerson>();
			this.cam.enabled = false;
		}

		// Token: 0x0600054E RID: 1358 RVA: 0x000345EC File Offset: 0x000327EC
		public void LateUpdate()
		{
			this.cam.UpdateInput();
			this.cam.UpdateTransform();
			Vector3 inputVector = CharacterController3rdPerson.inputVector;
			bool isMoving = CharacterController3rdPerson.inputVector != Vector3.zero || CharacterController3rdPerson.inputVectorRaw != Vector3.zero;
			Vector3 forward = this.cam.transform.forward;
			Vector3 aimTarget = this.cam.transform.position + forward * 10f;
			this.animatorController.Move(inputVector, isMoving, forward, aimTarget);
		}

		// Token: 0x1700007B RID: 123
		// (get) Token: 0x0600054F RID: 1359 RVA: 0x00005411 File Offset: 0x00003611
		public static Vector3 inputVector
		{
			get
			{
				return new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
			}
		}

		// Token: 0x1700007C RID: 124
		// (get) Token: 0x06000550 RID: 1360 RVA: 0x00005573 File Offset: 0x00003773
		public static Vector3 inputVectorRaw
		{
			get
			{
				return new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical"));
			}
		}

		// Token: 0x0400041E RID: 1054
		[SerializeField]
		public CameraController cam;

		// Token: 0x0400041F RID: 1055
		public AnimatorController3rdPerson animatorController;
	}
}
